package chart;

import java.awt.Shape;

// alternate ring
public class VerticalRing extends Ring
{

  public void createSegments()
  {
    Shape[] shapes = new Shape[SegmentsInfo.size()];
    double sum = 0;
    double span = this.end - this.start;
    for (int i = 0; i < SegmentsInfo.size(); i++)
    {
      sum += SegmentsInfo.get(i).Value;
    }

    double width = ringwidth / (double) SegmentsInfo.size();

    double r = this.radius;
    double strt = this.start;
    for (int i = 0; i < SegmentsInfo.size(); i++)
    {
      double extent = span; //(Values.get(i) / sum) *span;
      ArcSegment arc = new ArcSegment();
      shapes[i] = arc.Create(this.x, this.y, r, width, strt, extent);
      //strt += extent;
      r -= width;
    }

    this.segments = shapes;
  }
}
